package com.erp.app.flash;

//import com.erp.framework.flash.FlashForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.erp.framework.util.logger.Logger;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.erp.framework.web.SimpleAction;

public class FlashAction extends SimpleAction{
	public static final String actionOpenFlash = "openFlash";
	protected ActionForward handlePageEvent(ActionMapping mapping,
            ActionForm formIn,
            HttpServletRequest request,
            HttpServletResponse response,
            ActionErrors errors) {
		FlashForm form = (FlashForm)formIn;
		ActionForward forward = new ActionForward(mapping.getInput());
        String action = form.getAction();
		String pageEvt = form.getPageEvent();
		String pageEvtSrc = form.getPageEventSrc();
		Logger.log(action+"|"+pageEvt+"|"+pageEvtSrc);
        boolean handled = false;
        if ( !handled && actionOpenFlash.equals(action) ) {
            handled = true;
        }
        return forward;
	}
}
